using System.Text;
using MathMLToCSharp.Builders;

namespace MathMLToCSharp.Entities
{
  /// <summary>
  /// A table. Typically used for matrices.
  /// </summary>
  internal class Mtable : WithBuildableContents
  {
    public Mtable(IBuildable[] contents) : base(contents) {}
    public override void Visit(CodeBuilder cb, BuildContext context)
    {
      cb.Append("{");
      for (int i = 0; i < contents.Length; ++i)
      {
        contents[i].Visit(cb, context);
        if (i + 1 != contents.Length)
          cb.Append(", ");
      }
      cb.Append("}");
    }
  }
}